package com.feng.ioc.pojo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class World {
    @Value("洪荒大陆")
    private String domian;

//    @Autowired(required = false)
//    @Qualifier(value = "person2")
    private Person person;

    public World() {
    }

    @Autowired
     public  World( Person person){

         System.out.println("调用有参构造器");
         this.person = person;
     }
    public String getDomian() {
        return domian;
    }

    public void setDomian(String domian) {
        this.domian = domian;
    }

    public Person getPerson() {
        return person;
    }
//    @Autowired
    public void setPerson(Person person) {
        this.person = person;
    }
}
